<!doctype html>
<html xmlns:th="http://www.w3.org/1999/xhtml">

<head>
    <th:block th:include="/A0723/include :: header('套餐购买记录')"/>
</head>

<body>
<header class="mui-bar mui-bar-nav">
    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
    <h1 class="mui-title">套餐购买记录</h1>
</header>
<div class="mui-content">
    <!--  -->
    <ul class="record_list">
    </ul>
</div>
<th:block th:include="/A0723/include :: footer"/>

<script type="text/javascript">
    $(function () {
        getLevelRecord()
    })
    //获取转账记录
    function getLevelRecord() {
        mui.ajax(ctx+'front/levelRecord', {
            dataType: 'json',//服务器返回json格式数据
            type: 'get',//HTTP请求类型
            timeout: 10000,//超时时间设置为10秒；
            headers: {'Content-Type': 'application/json'},
            success: function (res) {
                //服务器返回响应，根据响应结果
                let data = res.data;
                let str = ''
                $.each(data, function (i, d) {
                    str += '<li>\n' +
                        '\<div>套餐名称：'+d.packageLevel.name+'</div>\n' +
                        '<div>购买时间：'+d.createTime+'</div>\n' +
                        '</li>'
                })
                $(".record_list").append(str);
            },
            error: function (xhr, type, errorThrown) {
                //异常处理；
                console.log(type);
            }
        });
    }
</script>
</body>

</html>
